using System;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.DataContracts;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.EventArgs;

namespace FU.Capstones.IMS.Web.Silverlight.Models
{
    public class LoginPopupModel : ModelBase
    {
        public event EventHandler<SingleFeedbackCompletedEventArgs<Account>> LoginCompleted;

        public LoginPopupModel()
        {
            client.LoginCompleted += DoLoginCompleted;
        }


        #region Login Service

        private void DoLoginCompleted(object sender, SingleFeedbackCompletedEventArgs<Account> e)
        {
            if (LoginCompleted != null)
            {
                LoginCompleted(sender, e);
            }
        }

        public void LoginAsync(Account account)
        {
            client.LoginAsync(account);
        }

        #endregion

    }
}